package com.dangdang.entity;

import java.util.List;

public class Category {
    private Integer id;
    private String name;
    private Integer pid;
    //一对多
    private List<Category> categories;
    //多对一
    private Category category;
    //每个类别有多少本书
    private Integer counts;

    public Category() {
    }

    public Category(Integer id, String name, Integer pid, List<Category> categories, Category category, Integer counts) {
        this.id = id;
        this.name = name;
        this.pid = pid;
        this.categories = categories;
        this.category = category;
        this.counts = counts;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public List<Category> getCategories() {
        return categories;
    }

    public void setCategories(List<Category> categories) {
        this.categories = categories;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Integer getCounts() {
        return counts;
    }

    public void setCounts(Integer counts) {
        this.counts = counts;
    }

    @Override
    public String toString() {
        return "Category{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", pid=" + pid +
                ", categories=" + categories +
                ", category=" + category +
                ", counts=" + counts +
                '}';
    }
}
